home *** CD-ROM | disk | FTP | other *** search
- MINLOC(3I) Last changed: 2-5-98
-
-
- NNAAMMEE
- MMIINNLLOOCC - Returns the location of a minimum value in an array
-
- SSYYNNOOPPSSIISS
- MMIINNLLOOCC (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
-
- MMIINNLLOOCC (([AARRRRAAYY==]_a_r_r_a_y [,,[MMAASSKK==]_m_a_s_k]))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- Fortran 90
-
- DDEESSCCRRIIPPTTIIOONN
- The MMIINNLLOOCC intrinsic function can be used for array location. It
- returns the location of the first element of _a_r_r_a_y that has the
- minimum value of the elements identified by _m_a_s_k. It accepts the
- following arguments:
-
- _a_r_r_a_y Must be of type integer or real. It must not be scalar.
-
- _d_i_m Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
- where _n is the rank of _a_r_r_a_y. The corresponding actual
- argument must not be an optional dummy argument. This
- function does a check on _d_i_m when present.
-
- _m_a_s_k Must be of type logical and must be conformable with _a_r_r_a_y.
-
- MMIINNLLOOCC is a transformational function. The name of this intrinsic
- cannot be passed as an argument.
-
- NNOOTTEESS
- On UNICOS systems, both execution speed and the number of bits used in
- mathematical operations are affected when compiling with
- ff9900 --OO ffaassttiinntt, which is the default setting. For more information,
- see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication
- SR-3901.
-
- RREETTUURRNN VVAALLUUEESS
- The result is an integer array of type default integer, of rank one,
- with size equal to the rank of _a_r_r_a_y.
-
- The result of MMIINNLLOOCC((_a_r_r_a_y)) is a rank-one array whose element values
- are the values of the subscripts of an element of _a_r_r_a_y whose value
- equals the minimum value of all of the elements of _a_r_r_a_y. The _ith
- subscript returned lies in the range 1 to _e ,
- _i
- where _e
- _i
- is the extent of the _ith dimension of _a_r_r_a_y. If more than one element
- has the minimum value, the element whose subscripts are returned is
- the first such element, taken in array element order. If _a_r_r_a_y has
- size zero, the value of the result is undefined.
-
- The result of MMIINNLLOOCC((_a_r_r_a_y,,MMAASSKK==_m_a_s_k)) is a rank-one array whose
- element values are the values of the subscripts of an element of
- _a_r_r_a_y, corresponding to a true element of _m_a_s_k whose value equals the
- minimum value of all such elements of _a_r_r_a_y. The _ith subscript
- returned lies in the range 1 to _e ,
- _i
- where _e
- _i
- is the extent of the _ith dimension of _a_r_r_a_y. If more than one such
- element has the minimum value, the element whose subscripts are
- returned is the first such element taken in array element order. If
- there are no such elements (that is, if _a_r_r_a_y has size zero or every
- element of _m_a_s_k has the value false), the value of the result is
- undefined.
-
- If _a_r_r_a_y has rank one, the result of
- MMIINNLLOOCC((_a_r_r_a_y,, DDIIMM==_d_i_m [,, MMAASSKK==_m_a_s_k])) is a scalar with a value that is
- the same as that of the first element of MMIINNLLOOCC((_a_r_r_a_y [,, MMAASSKK==_m_a_s_k])).
- Otherwise, the value of element (_s , _s , ..., _s , _s , ..., _s )
- 1 2 _d_i_m-1 _d_i_m+1 _n
- of the result is equal to
- MMIINNLLOOCC((_a_r_r_a_y(_s , _s , ..., _s , : , _s , ..., _s )),, DDIIMM==11
- 1 2 _d_i_m-1 _d_i_m+1 _n
- [,, MMAASSKK==_m_a_s_k(_s , _s , ..., _s , : , _s , ..., _s )])).
- 1 2 _d_i_m-1 _d_i_m+1 _n
- An element of the result is undefined if the value cannot be
- represented as an integer.
-
- EEXXAAMMPPLLEESS
- Example 1: The value of MMIINNLLOOCC(( ((// 44,, 33,, 66,, 33 //)) )) is [2]. If array
- B is declared IINNTTEEGGEERR,, DDIIMMEENNSSIIOONN((44::77)) :::: BB == ((//88,, 66,, 33,, 11 //)), the
- value of MMIINNLLOOCC((BB)) is [4].
-
- Example 2: Assume that AA is the following array:
-
- | 0 -5 8 -3 |
-
- | 3 4 -1 2 |
-
- | 1 5 6 -4 |
-
- The following are true:
-
- MMIINNLLOOCC((AA)) is [1, 2]
-
- MMIINNLLOOCC((AA,, MMAASSKK==AA ..GGTT.. --44)) is [1, 4]
-
- Using array section references, the following are true:
-
- MMIINNLLOOCC((AA((22::33,,22::44)))) is [ 2, 3 ]
-
- MMIINNLLOOCC((AA((22::33,,22::44)),,MMAASSKK==AA((22::33,,22::44))..GGTT..--44)) is [ 1, 2 ]
-
- Example 3: Assume that BB is the following array:
-
- [ 100, 2, 5, 7, 1, 90, 0, 20, -1, 80 ]
-
- The following are true:
-
- MMIINNLLOOCC((BB((1100::11::--11)))) is 2
-
- MMIINNLLOOCC((BB((1100::11::--22)))) is 5
-
- Example 4: The value of MMIINNLLOOCC((((//55,,--99,,33//)),,DDIIMM==11)) is 22.
-
- Example 5: Assume that CC is the following array:
-
- | 1 3 -9 |
-
- | 2 2 6 |
-
- The following are true of this array:
-
- MMIINNLLOOCC((CC,,DDIIMM==11)) is [ 1, 2, 1 ]
-
- MMIINNLLOOCC((CC,,DDIIMM==22)) is [ 3, 1 ]
-
- MMIINNLLOOCC((CC)) is [ 3, 1 ]
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
- printed version of this man page.
-